<template>
   <div>
       <div class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
    <div class="mui-scroll">
        <a class="mui-control-item mui-active" @click="getpicture">
            推荐
        </a>
        <a class="mui-control-item">
            热点
        </a>
        <a class="mui-control-item">
            北京
        </a>
        <a class="mui-control-item">
            社会
        </a>
        <a class="mui-control-item">
            娱乐
        </a>
        <a class="mui-control-item">
            科技
        </a>
    </div>
</div>
<div>
    <ul class="photo-list">
        <router-link :to="'/home/photoinfo/'+item.forward" tag="li" v-for="item in list" :key="item.id">
            <img v-lazy="item.thumbnail">
            <div class="info">
                <h1 class="info-title">{{item.top_commentsContent}}</h1>
                <div class="info-body">{{item.text}}</div>
            </div>
        </router-link>
</ul>
</div>
   </div>

</template>
<script>
// import mui from '../../lib/mui/js/mui.min.js'

// mui('.mui-scroll-wrapper').scroll({
// 	deceleration: 0.0005 //flick 减速系数，系数越大，滚动速度越慢，滚动距离越小，默认值0.0006
// });

export default {
    data() {
        return {
            cates:[],
            list:[]
        }
    },
    created() {
        // this.getAllCategory()
    },
    mounted() {
    },
    methods: {
        // getAllCategory(){
        //     this.$http.get('satinGodApi?type=5&page=1').then(result=>{
        //         if(result.body.code===200){
        //             result.body.message.unshift({title:"全部",id:0});
        //             this.cates=result.body.message
        //         };
        //     })
        // }
        getpicture(){
            this.$http.get('satinGodApi?type=5&page=1').then(result=>{
                if(result.body.code===200){
                    console.log(result.body);
                    
                    this.list=result.body.data;
                }
            })
        }
    },
}
</script>
<style lang="less">
*{
    touch-action: pan-y;
}
.photo-list{
   list-style: none;
   margin: 0;
   padding: 10px;
    li{
        position: relative;
        background: #ccc;
        text-align: center;
        margin-bottom: 10px;
        box-shadow: 0 0 10px #999;
        img{
            width: 100%;
            vertical-align: middle;
        }
        img[lazy=loading] {
             width: 40px;
            height: 300px;
            margin: auto;
        }
        .info{
            color: white;
            text-align: left;
            position: absolute;
            bottom: 0px;
            width: 100%;
            max-height: 100px;
            background-color: rgba(0, 0, 0, 0.5);
            .info-title{
                font-size: 20px;
            }
            .info-body{
                font-size: 15px;
            }
        }
    }
}
</style>

